home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Programmer Disk
/
The Programmer Disk (Microforum).iso
/
xpro
/
pascal3
/
pro22
/
dt.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1988-08-23
|
2KB
|
61 lines
Program Stamp;
{
By Timothy B. Coleman. This program usses Turbo Pascal Ver. 4's Date and time
Procedures, bu produces a larger .EXE file than the larger source in STAMP.PAS.
}
Uses DOS;
Var
ThisDate : String[15];
Time : String[15];
PROCEDURE TPDate;
Type
String9 = String[9];
Const
MonthNames : array [1..12] of String9 =
('January','February','March','April','May','June',
'July','August','September','October','November','December');
VAR
Year,Month,Day,DayOfWeek : Word;
Temp1, DateString, Temp2 : String[16];
Begin
GetDate(Year,Month,Day,DayOfWeek);
Str(Year,Temp1);
DateString := MonthNames[Month];
Str(Day,Temp2);
DateString := DateString + ' ' + Temp2 + ', ' + Temp1;
ThisDate := Datestring;
end;
Procedure TPTime;
Var
TimeString : String[16];
TempTime : String[5];
Hours, Minutes, Seconds,Hundredths : Word;
Begin
GetTime(Hours,Minutes,Seconds,Hundredths);
Str(Hours,TempTime);
If length(TempTime) = 1 Then TempTime := '0' + TempTime;
TimeString := TempTime + ':';
Str(Minutes,TempTime);
If length(TempTime) = 1 Then TempTime := '0' + TempTime;
TimeString := TimeString + TempTime + ':';
Str(Seconds,TempTime);
If length(TempTime) = 1 Then TempTime := '0' + TempTime;
TimeString := Timestring + Temptime;
Time := TimeString;
end; { GetTime }
Begin {main}
TPDate;
TPTime;
Writeln('Date and Time: ',ThisDate,' ',Time); {No Direct video so
redirectable to a file or printer, serial or par.}
end.